/**
 * checkAll
 * 选中所有
 * @param strChkName
 */
function checkAll(strChkName){	
	if(document.all[strChkName] == undefined){
		alert("没有待选项!");
		return false;
	}else{
		if(document.all[strChkName].length == undefined){
			document.all[strChkName].checked = true;
		}else{
        	for(i=0; i<document.all[strChkName].length; i++){
        		document.all[strChkName][i].checked = true;
        	}
        }
    }
}

/**
 * cancelAll
 * 取消所有选择
 * @param strChkName
 */
function cancelAll(strChkName){
	if(document.all[strChkName] == undefined){
		alert("没有待选项!");
		return false;
	}else{
    	if(document.all[strChkName].length == undefined){
			document.all[strChkName].checked = false;
		}else{
        	for(i=0; i<document.all[strChkName].length; i++){
        		document.all[strChkName][i].checked = false;
        	}
        }
    }
}

/**
 * actionIt
 * 提交事件
 * @param strfrm 要处理的from名称
 * @param strChkName 要处理的CheckBox 表单名称
 * @param bolAction 为from中的act表单设置值
 * @param strCfm 确认提示信息，为0则不进行确认提示
 */
function actionIt(strfrm, strChkName, bolAction, strCfm){
	var strtemp = '0';
	var objFrm = document.getElementById(strfrm);
	if(document.all[strChkName] == undefined){
		alert("没有待选项!");
		return false;
	}else{		
    	if(document.all[strChkName].length == undefined){			
			if(document.all[strChkName].checked == true){
				strtemp = strtemp+"','"+document.all[strChkName].value;			
			}
		}else{
	    	for(i=0; i<document.all[strChkName].length; i++){
	    		if(document.all[strChkName][i].checked == true){	    			
					strtemp = strtemp+"','"+document.all[strChkName][i].value;															
	    		}
	    	}
	    }
        
        if(strtemp == '0'){
        	alert("没有选择待选项!");
        	return false;
        } else{  
        	if(strCfm != '0'){
    			if(confirm(strCfm)){    			
	    			document.all['selList'].value = strtemp;	    			    			    			
	    			document.all['act'].value = bolAction;
	    			document.forms[strfrm].submit();
    			}
		 	}else{
    			document.all['selList'].value = strtemp;	    			    			    			
    			document.all['act'].value = bolAction;
				document.forms[strfrm].submit();
			}
        }
	}
}